package com.jvm.d5;

/**
 * 描述:
 *
 * @author luzhongfu
 * Created by lucky on 2019-10-12 3:23 PM
 */

// 编译并用 javap -c 查看编译后的字节码
public class Foo {
    private int tryBlock;
    private int catchBlock;
    private int finallyBlock;
    private int methodExit;

    public void test() {
        for (int i = 0; i < 100; i++) {
            try {
                tryBlock = 0;
                if (i < 50) {
                    continue;
                } else if (i < 80) {
                    break;
                } else {
                    return;
                }
            } catch (Exception e) {
                catchBlock = 1;
            } finally {
                finallyBlock = 2;
            }
        }
        methodExit = 3;
    }

    public void test2() throws Exception{
        try {
            int a = 1/ 0;
        }catch (Exception e){
            throw new Exception("hhh");
        }finally {
            return;
        }
    }

    public static void main(String[] args)  throws Exception{
        Foo foo = new Foo();
        foo.test2();
    }
}

